public class Main1261{
    public static void main(String[] args) {
        int i=1;
        while (true){
            if (i%5==1&&i%6==5&&i%7==4&&i%11==10){
                System.out.println(i);
                break;
            }else {
                i++;
            }
        }
    }
}
